package com.will.txj.aj.security.listener;


import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import javax.servlet.ServletContext;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import javax.servlet.annotation.WebListener;

/**
 * @author: wen-yi;
 * @date: 2021/12/5 10:46;
 * @Description:
 */
@Slf4j
@Component
@WebListener
public class ContextListener implements ServletContextListener {
    @Override
    public void contextInitialized(ServletContextEvent sce) {
        //ServletContext sc = sce.getServletContext();
        //log.info("realPath: {}, resourceAsStream: {}, contextPath: {}", sc.getRealPath("/"),sc.getResourceAsStream("/"),sc.getContextPath());
        log.info("创建:ServletContextEvent");
    }

    @Override
    public void contextDestroyed(ServletContextEvent sce) {
        log.info("销毁:ServletContextEvent");
    }

}
